////
////  PlatformRouterImp.swift
////  Runner
////
////  Created by 李旭峰 on 2020/10/10.
////
//
//import Foundation
//
//let kNativeFirstViewPageUrl = "asman://nativeFirstPage"
//let kNativeSecondViewPageUrl = "asman://nativeSecondPage"
//let kFlutterFirstViewPageUrl = "flutter://FirstRoutePage"
//let kFlutterSecondViewPageUrl = "flutter://SecondRoutePage"
//let kNativeVrPageUrl = "asman://nativeVrPage"
//
//class PlatformRouterImp: NSObject, FLBPlatform {
//    
//    
//    func open(_ url: String, urlParams: [AnyHashable : Any], exts: [AnyHashable : Any], completion: @escaping (Bool) -> Void) {
//        switch url {
//        case kNativeFirstViewPageUrl:
//            let native_firstVC = NativeFirstViewController()
//            self.navigationController().pushViewController(native_firstVC, animated: true)
//            completion(true)
//        case kNativeSecondViewPageUrl:
//            let native_secondVC = NativeSecondViewController()
//            self.navigationController().pushViewController(native_secondVC, animated: true)
//            completion(true)
//        case kNativeVrPageUrl:
//            guard let path = urlParams["vrPath"] as? String,let url = URL(string: path) else {
//                completion(false)
//                return
//            }
//            let native_vrVC = SchemeProgramViewController(withUrl: nil)
//            native_vrVC.resetUrlPath(url)
//            self.navigationController().pushViewController(native_vrVC, animated: true)
//            completion(true)
//        case kFlutterFirstViewPageUrl:
//            var animated = false;
//            if exts["animated"] != nil{
//                animated = exts["animated"] as! Bool;
//            }
//            let vc = FLBFlutterViewContainer.init();
//            vc.setName(url, params: urlParams);
//            self.navigationController().pushViewController(vc, animated: animated);
//            completion(true);
//        case kFlutterSecondViewPageUrl:
//            var animated = false;
//            if exts["animated"] != nil{
//                animated = exts["animated"] as! Bool;
//            }
//            let vc = FLBFlutterViewContainer.init();
//            vc.setName(url, params: urlParams);
//            self.navigationController().pushViewController(vc, animated: animated);
//            completion(true);
//        default:completion(false)
//        }
//    }
//    
//    func present(_ url: String, urlParams: [AnyHashable : Any], exts: [AnyHashable : Any], completion: @escaping (Bool) -> Void) {
//        var animated = false;
//        if exts["animated"] != nil{
//            animated = exts["animated"] as! Bool;
//        }
//        let vc = FLBFlutterViewContainer.init();
//        vc.setName(url, params: urlParams);
//        navigationController().present(vc, animated: animated) {
//            completion(true);
//        };
//    }
//    
//    func close(_ uid: String, result: [AnyHashable : Any], exts: [AnyHashable : Any], completion: @escaping (Bool) -> Void) {
//        var animated = false;
//        if exts["animated"] != nil{
//            animated = exts["animated"] as! Bool;
//        }
//        let presentedVC = self.navigationController().presentedViewController;
//        let vc = presentedVC as? FLBFlutterViewContainer;
//        if vc?.uniqueIDString() == uid {
//            vc?.dismiss(animated: animated, completion: {
//                completion(true);
//            });
//        }else{
//            self.navigationController().popViewController(animated: animated);
//        }
//    }
//    
//    func navigationController() -> UINavigationController {
//        let delegate = UIApplication.shared.delegate as! AppDelegate
//        let navigationController = delegate.window?.rootViewController as! UINavigationController
//        return navigationController;
//    }
//}
//
